package top.haijunit.navi.auth.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import top.haijunit.navi.auth.domain.PermissionInfo;
import top.haijunit.navi.auth.entity.PermissionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import top.haijunit.navi.auth.entity.PermissionRelationEntity;

import java.util.List;


/**
 * 针对表权限表(permission)的数据库操作Mapper.java
 *
 * @author zhanghaijun
 * @since 2024-10-25 16:33:25
 */
@Mapper
public interface PermissionMapper extends BaseMapper<PermissionEntity> {
    @Select("select count(1) from access_permission where group_code = #{groupCode}")
    Boolean existsPermissionByGroupCode(@Param("groupCode") Long groupCode);

    List<PermissionInfo> selectPermissionList(@Param(Constants.WRAPPER) Wrapper<PermissionEntity> wrapper);

    List<PermissionRelationEntity> selectPermissionRelationList(@Param(Constants.WRAPPER) Wrapper<PermissionRelationEntity> wrapper);

}




